<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>e网批发管理后台</title>
	<link href="css/styles.css" rel="stylesheet" type="text/css" />
	<link href="css/sub.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="js/jquery.min.js"></script>
  <link href="css/style2.css" rel="stylesheet" type="text/css" />
</head>
<?php 
include("common/header.php");
include("Controller/sub.php");
?>

<body>

<body>
<button type="button" class="submit deliveryp">新增账号</button>
<table class="bordered">
    <thead>
	    <tr>
	    	<th>id</th>
	        <th>账号</th>        
	        <th>密码</th>
	        <th>操作</th>
	    </tr>
    </thead>
    <?php foreach ($res as $key => $value) {?>
	    <tr>
	    	<td>
	    		<?php echo $value['id']; ?>
	    	</td>
	        <td>
	        	<?php echo $value['sub_name']; ?>
	        </td>        
	        <td>
	        	<?php echo $value['password']; ?>
	        </td>
	        <td>
		        <a href="sub_edit.php?action=edit&id=<?php echo $value['id']; ?>">修改</a>   
		        <a href="?action=del&id=<?php echo $value['id']; ?>">删除</a>
	        </td>
	    </tr>
	<?php } ?>
</table>
<br><br>

<div class="alert_divp">
  <div class="alert_title">
    新建账号
  </div> 
  <div class="alert_line"></div>
  <div class="alert_body">
    <form id="alert_form" action="" method="post">
      <label>账号:</label><input type="text" class="text" name="sub_name" value="">
      <label>密码:</label><input type="text" class="text" name="password" value="" placeholder="这里输入6位数字密码">
    </form>
  </div>
  <div class="alert_foot">
    <div class="foot-div">
      <button type="button" class="submit" id="submit1">提交</button>
      <button type="button" class="submit" id="cancel1">取消</button>
    </div>
  </div>
</div>

</body>
</html>
<script> //js脚本标注

  $('#submit1').click(function(){
    $('#alert_form').submit();
    $('.mask_div').hide();
    $('.alert_divp').hide();
  });

  $('#cancel1').click(function(){
    $('.mask_div').hide();
    $('.alert_divp').hide();
  })

  $('.deliveryp').click(function(){
    var ordersid=$(this).parent().find('#checkbox').val();
    $('#ordersid').attr('value',ordersid);
    $('.mask_div').show();
    $('.alert_divp input[type="text"]').attr('value','');
    $('.alert_divp').show();
  })
</script>
